/*
 * @Author: DT1604\ZPL zhoupeili@dpc.com.cn
 * @Date: 2022-05-25 17:38:49
 * @LastEditors: DT1604\ZPL zhoupeili@dpc.com.cn
 * @LastEditTime: 2022-07-19 11:43:45
 * @FilePath: \energy-om-platform\src\api\cabint.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import request from '@/utils/request'

// 设备
export function equip(url, method, params,type) {
  if (type == 1) {
    return request({
      url: '/api/equipment' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/equipment' + url,
      method: method,
      params
    })
  }
}
// 枚举
export function enums() {
  return request({
    url: '/api/enum/all',
    method: 'get'
  })
}
// 升级
export function softUpdate(url, method, type, params) {
  if (type == 1) {
    return request({
      url: '/api/softwareupgrade' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/softwareupgrade' + url,
      method: method,
      params
    })
  }
}
// 日志提取
export function logtract(url, params) {
  return request({
    url: '/api/logextract' + url,
    method: 'post',
    data: params
  })
}
// 日志级别
export function loglevel() {
  return request({
    url: '/api/loglevel/enables',
    method: 'get'
  })
}
// 软件版本集合
export function softversion(params) {
  return request({
    url: '/api/softwareversion/enables',
    method: 'get',
    params
  })
}
export function readversion(url, params) {
  return request({
    url: '/api/equipment/param' + url,
    method: 'get',
    params
  })
}
// 软件版本list
export function software(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/softwareversion' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/softwareversion' + url,
      method: method,
      params
    })
  }
}
export function equipUpdate(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/equipmentupgrade' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/equipmentupgrade' + url,
      method: method,
      params
    })
  }
}
